Skip to content

Conversation

@martinohmann
Copy link

@martinohmann martinohmann commented Sep 6, 2024

Updates #238

This solves the most prominent credential leak. With every new connection the passwords were leaked to the logs visible in the UI as well.

With this change only the stream name gets logged here.

There are other places in the codebase where we still log secret embedded in URLs, but a lot of them lack access to the stream name they could be replaced with. Most of these occurances are debug logs (which are not an issue if you're running go2rtc at >= info level), but some are warning level though. I can try to come up with a fix in a followup PR.

This change is a simpler alternative to #1219 to address the issue to rid of the password in the log line emitted whenever a stream is created.

Before:

[streams] create new stream url=rtsp://stream:[email protected]:554/stream1

After:

[streams] create new stream garage-cam

This solves the most prominent credential leak. With every new
connection the passwords were leaked to the logs visible in the UI as
well.

With this change only the stream name gets logged here.

There are other places in the codebase where we still log secret
embedded in URLs, but a lot of them lack access to the stream name they
could be replaced with. Most of these occurances are debug logs, but
some are warning level though. I can try to come up with a fix in a
followup PR.

This change is a simpler alternative to
AlexxIT#1219 to address the issue to rid
of the password in the log line emitted whenever a stream is created:

    [streams] create new stream url=rtsp://stream:[email protected]:554/stream1

    [streams] create new stream garage-cam
log zerolog.Logger
streams = map[string]*Stream{}
streamsMu sync.Mutex
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gofmt did this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant